// 1. 定义一个抽象类
abstract class Abstract {
    constructor() {
        console.log('Abstract Class')
    }
    abstract method(): void
}

// 2. 定义一个实现类
class Implement extends Abstract {
    constructor() {
        super()
        console.log('Implement Class')
    }
    method() {
        console.log('Implement Class Method')
    }
}

// 3. 定义一个桥接类
class Bridge {
    private abstract: Abstract
    constructor(abstract: Abstract) {
        this.abstract = abstract
    }
    method() {
        console.log('Bridge Class Method')
        this.abstract.method()
    }
}

// 4. 实例化一个实现类
const implement = new Implement()

// 5. 实例化一个桥接类
const bridge = new Bridge(implement)
bridge.method()